<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}">博客详情</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="icon" href="/images/CP3.jpg" type="image/x-icon">
    <link rel="stylesheet" href="/css/typo.css">
    <link rel="stylesheet" href="/css/animate.css">
    <link rel="stylesheet" href="/lib/prism/prism.css">
    <link rel="stylesheet" href="/lib/tocbot/tocbot.css">
    <link rel="stylesheet" href="/lib/editormd/css/editormd.min.css">
    <link rel="stylesheet" href="/css/me.css">
    <link rel="stylesheet" href="/css/jquery.emoji.css">

    <!--百度统计-->
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?6b1eb02bacb648d682681dc81149e144";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>

</head>
<body>


<!--导航-->
<nav th:fragment="menu(n)" class="ui inverted attached m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item" style="right: 10px">Brandt_blog</h2>
            <a th:href="@{/}" class="m-item item m-mobile-hide" th:classappend="${n==1} ? 'active'"><i class="mini home icon"></i>首页</a>
            <a th:href="@{/types/-1}" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="mini idea icon"></i>分类</a>
            <a th:href="@{/tags/-1}" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i class="mini tags icon"></i>标签</a>
            <a th:href="@{/archives}" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'"><i class="mini clone icon"></i>归档</a>
            <a th:href="@{/Messages}" class="m-item item m-mobile-hide" th:classappend="${n==5} ? 'active'"><i class="mini envelope outline icon"></i>&nbsp;留言</a>
            <a th:href="@{/about}" class="m-item item m-mobile-hide" th:classappend="${n==6} ? 'active'"><i class="mini info icon"></i>关于我</a>

            <div class="right m-item item m-mobile-hide" style="left: 118px;">
                    <form name="search" th:action="@{/search}" method="post">
                        <div class="ui icon inverted transparent input m-margin-tb-tiny">
                            <input type="text" name="query" placeholder="搜索" th:value="${query}">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                    </form>
            </div>

            <div class="right m-item m-mobile-hide item" style="left: 170px;">
                <div th:classappend="${session.loginStatus}?'myHideStyle':'myShowStyle'">
                    <a href="#"  th:href="@{/qq/oauth}" style="width:80px; text-align:center;color: #c2c3c4;"><i class="mini qq icon"></i>QQ登录&nbsp;|</a>
                    <a href="https://github.com/login/oauth/authorize?client_id=9e857aec6b9407f6a20b&redirect_uri=http://www.xiaozhu888.top/github/callback&scope=user&state=1" style="width:80px; text-align:center;color: #c2c3c4;"><i class="github icon"></i>github登录&nbsp;|</a>
                    <a href="#" target="_blank" th:href="@{/admin}" style="width:80px; text-align:center;color: #c2c3c4;"><i class="mini user secret icon"></i>&nbsp;后台管理</a>
                </div>

                <div class="ui dropdown item" th:classappend="${session.loginStatus}?'myShowStyle':'myHideStyle'">
                    <div class="text">
                        <img class="ui avatar image" th:src="${session.avatar}">
                        <span th:text="${session.nickname}">Brandt</span>
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu" th:if="${session.loginType == 1}">
                        <a href="#" th:href="@{/qqinfo}" class="item">QQ资料</a>
                        <a href="#" th:href="@{/qqlogout}" class="item">退出登录</a>
                    </div>
                    <div class="menu" th:if="${session.loginType == 2}">
                        <a href="#" th:href="@{/githubInfo}" class="item">Github资料</a>
                        <a href="#" th:href="@{/githublogout}" class="item">退出登录</a>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--底部footer-->
<footer style="background-color: inherit;" th:fragment="footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div>
        <!--引入天气预报插件-->
        <!--https://cj.weather.com.cn/plugin/pc-->
        <div id="weather-float-he"></div>
    </div>

    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="/images/1000141.jpg" class="ui rounded image" alt="" style="width: 110px;">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced " >最新博客</h4>
                <div id="newblog-container">
                    <div class="ui inverted link list" th:fragment="newBlogList">
                        <a th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="item m-text-thin" th:each="blog : ${newblogs}" th:text="${blog.title}">用户故事（User Story）</a>
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                <div class="ui inverted link list">
                    <p class="item m-text-thin">email：357345226@qq.com</p>
                    <p class="item m-text-thin">QQ：357345226</p>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">Blog</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">分享自己写的一些笔记、文章，有兴趣的可以看看...</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">BrandtBei © 2020 朱志辉 Designed by Zhuzhihui</p>
        <p class="m-text-thin m-text-spaced m-opacity-tiny"><a href="http://www.beian.miit.gov.cn/">粤ICP备20026977号</a></p>

        <span style="color: #b9eec1" id="timeDate">载入天数...</span><span style="color: #b9eec1" id="times">载入时分秒...</span>
        <script>
            var now = new Date();
            function createtime() {
                var grt= new Date("5/02/2020 00:00:00");//在此处修改你的建站时间，格式：月/日/年 时:分:秒
                now.setTime(now.getTime()+250);
                days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days);
                hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours);
                if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
                mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;}
                seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
                snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;}
                document.getElementById("timeDate").innerHTML = "本站已安全运行 "+dnum+" 天 ";
                document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒";
            }
            setInterval("createtime()",500);
        </script>


    </div>

</footer>

<th:block th:fragment="script">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
    <script src="/lib/prism/prism.js"></script>
    <script src="/lib/editormd/editormd.min.js"></script>
    <script src="/lib/tocbot/tocbot.min.js"></script>
    <script src="/lib/qrcode/qrcode.min.js"></script>
    <script src="/lib/waypoints/jquery.waypoints.min.js"></script>
    <script src="/js/jquery.emoji.js"></script>
    <script src="/js/emoji.list.js"></script>


    <script th:inline="javascript">
        $('#newblog-container').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");
    </script>

    <script>
        $('.ui.dropdown').dropdown({
            on: 'hover'
        });
    </script>

    <!--适配移动端和电脑端-->
    <script type="text/javascript">
        var browser = {
            versions: function () {
                var u = navigator.userAgent, app = navigator.appVersion;
                return {     //移动终端浏览器版本信息
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                    iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    webApp: u.indexOf('Safari') == -1 //是否web应用程序，没有头部与底部
                };
            }(),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }
        if (browser.versions.mobile) {

        }else if(!browser.versions.mobile){ //非移动端，动态加载js和div

            // var script1 = document.createElement('script');
            // script1.type = 'text/javascript';
            // script1.src = '\\js\\snow.js';

            <!-- 天气预报 -->
            WIDGET = {FID: 'EtgqPWMbdv'};
            var script4 = document.createElement('script');
            script4.type = 'text/javascript';
            script4.src = 'https://apip.weatherdt.com/float/static/js/r.js?v=1111';

            var script2 = document.createElement('script');
            script2.type = 'text/javascript';
            script2.src = '\\js\\click_show_text.js';

            var script3 = document.createElement('script');
            script3.type = 'text/javascript';
            script3.color = '220,220,220';
            script3.opacity = '10';//透明度
            script3.zIndex = '-2';
            script3.count = '300';
            script3.src = '//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js';

            // $('body').append(script1);
            $('body').append(script4);
            $('body').append(script2);
            $('body').append(script3);
        }
    </script>

</th:block>




</body>
</html>